<template>
     <div class="custom-dialog-mask" v-if="showMarkerInfo" @click.self="showMarkerInfo = false">
        <div class="custom-dialog">
          <div class="dialog-header">
            <h3>{{ position }} 标记点名称</h3>
            <button class="close-btn" @click="showMarkerInfo = false">&times;</button>
          </div>

          <div class="dialog-body">
            <div class="form-group">
              <label>标记名称</label>
              <input type="text" v-model="name" @change="updateNameHanadler">
            </div>
          </div>
          <div class="dialog-footer">
            <button class="confirm-btn" @click="showMarkerInfo = fales">完成</button>
          </div>
        </div>
      </div>
</template>
<script lang="ts" >

import { Component, Prop, Vue, Emit} from 'vue-property-decorator';


@Component
export default class MarkerInfo extends Vue {
    @Prop()
    private showMarkerInfo = false;
    private name;
    @Prop()
    private position;

    @Emit('update-marker-name')
    updateLayerStyle(){
        return name;
    }
}

</script>
<style scoped>
/* 保留原有样式或根据需要调整 */
.custom-dialog-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.custom-dialog {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 400px;
  max-width: 90vw;
  animation: dialogSlideIn 0.3s ease;
}

.dialog-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.dialog-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0 4px;
}

.close-btn:hover {
  color: #333;
}

.dialog-body {
  padding: 16px;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-group label {
  flex: 0 0 80px;
  font-size: 14px;
  color: #666;
}



input[type="range"] {
  flex: 1;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #1890ff;
  border-radius: 50%;
  cursor: pointer;
}

input[type="number"] {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

select {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
}

.value-display {
  width: 40px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.dialog-footer {
  padding: 16px;
  border-top: 1px solid #eee;
  text-align: right;
}

.confirm-btn {
  background: #1890ff;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.confirm-btn:hover {
  background: #40a9ff;
}

/* 图层项样式 */
.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}


.layer-settings-btn {
    padding: 5px;
    margin-left: 10px;
}

</style>